package com.example.samplehelloandroid;


import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RotateDrawable;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

public class MainActivity extends Activity {

	EditText inputText;
	TextView outText;
	RotateDrawable mDrawable;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        inputText = (EditText)findViewById(R.id.editText1);
        outText = (TextView)findViewById(R.id.textView1);
        Button btn = (Button)findViewById(R.id.button1);
        btn.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				outText.setText(inputText.getText().toString());
			}
		});
        
        ImageView imageView = (ImageView)findViewById(R.id.imageView1);
        mDrawable = (RotateDrawable)imageView.getDrawable();
        btn = (Button)findViewById(R.id.button2);
        btn.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				int level = mDrawable.getLevel();
				level = (level + 1000) % 10000;
				mDrawable.setLevel(level);
			}
		});
        
        int myColor = getResources().getColor(R.color.color_red);
        String myMessage = getResources().getString(R.string.my_message);
        String[] myArray= getResources().getStringArray(R.array.myArray);
        Drawable myDrawable = getResources().getDrawable(R.drawable.cross);
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}
